package com.alstudio.module.xmpp.protocol.xmpp;

import java.util.ArrayList;

import com.alstudio.module.xmpp.protocol.xmpp.data.ALXmppConnectionState;
import com.alstudio.module.xmpp.protocol.xmpp.data.ALXmppData;
import com.alstudio.module.xmpp.protocol.xmpp.data.VauthData;
import com.alstudio.module.xmpp.protocol.xmpp.data.economic.EconomicRecords;
import com.alstudio.module.xmpp.protocol.xmpp.data.economic.RechargeItem;
import com.alstudio.module.xmpp.protocol.xmpp.packact.ALMessage;
import com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.BaseIQTemplate;
import com.alstudio.pojo.module.dating.DatingUser;
import com.alstudio.pojo.module.local.Prop;
import com.alstudio.pojo.module.local.Props;
import com.alstudio.pojo.module.user.User;
import com.alstudio.utils.android.net.ALConnectionManager;
import com.alstudio.utils.log.ALLog;
import com.alstudio.utils.notification.SystemSettings;

public class ALXmppAdapter implements ALXmppListener {

	/* XMPP连接控制对象 */
	private ALXmppProtocol mProtocol = null;
	// XMPP事件监听器
	private ALXmppEventListener mListener;

	private ALXmppData mData;

	public ALXmppAdapter(ALXmppEventListener listener) {
		// TODO Auto-generated constructor stub
		mListener = listener;
	}
	
	/**
	 * @return the mListener
	 */
	public ALXmppEventListener getXmppListener() {
		return mListener;
	}

	/**
	 * 设定回调函数
	 * 
	 * @param listener
	 * @author alonso lee
	 */
	public void addXmppListener(ALXmppEventListener listener) {
		this.mListener = listener;
	}

	/**
	 * 移除回调函数
	 * 
	 * @author alonso lee
	 */
	public void removeXmppListener() {
		this.mListener = null;
	}

	/**
	 * 设定连接参数
	 * 
	 * @param data
	 * @author alonso lee
	 */
	public void setXmppData(ALXmppData data) {
		if (mProtocol != null) {
			mProtocol.setXmppData(data);
		}
	}

	/**
	 * 获取连接参数
	 * 
	 * @return
	 * @author alonso lee
	 */
	public ALXmppData getXmppData() {
		// return mProtocol == null ? mProtocol.getXmppData() : null;
		return mData;
	}

	/**
	 * 获取当前XMPP登陆状态
	 * 
	 * @return
	 */
	public ALXmppConnectionState xmppCheckLoginState() {
		return ALXmppProtocol.getConnectionState();
	}

	/**
	 * 断开当前连接,结束当前线程
	 */
	public void xmppCleanConnection() {
		ALLog.d("calling xmppCleanConnection");
		/* jxa为空，或者没有登陆到XMPP服务器。不做任何操作 */
		if ((mProtocol == null) /* || (!jxa.isAuthenticated()) */) {
			ALLog.w("No XMPP Connection.Refuse");
			// onJxaConnFailed("No XMPP Connection");
			return;
		}
		mProtocol.logoff();
	}

	/**
	 * 断开流
	 * 
	 * @author Alonso Lee
	 */
	public void xmppDisconnect() {
		ALLog.d("calling xmppDisconnect");

		/* jxa为空，或者没有登陆到XMPP服务器。不做任何操作 */
		if ((mProtocol == null) || (!mProtocol.isAuthenticated())) {
			ALLog.w("No XMPP Connection.Refuse");
			// onJxaConnFailed("No XMPP Connection");
			return;
		}
		mProtocol.logoff();
	}

	public void xmppRegister(ALXmppData data) {
		if (mProtocol != null) {
			if (ALXmppProtocol.getConnectionState() != ALXmppConnectionState.XMPP_STATE_IDLE) {
				// 当前已经连接了，那么先断开当前的连接
				mProtocol.logoff();
			}
		}
		data.setNetType(ALConnectionManager.getConnectionTypeString());
		mProtocol = new ALXmppProtocol(data, mListener);
		mData = data;
		// 开始登录咯
		mProtocol.start();
	}

	public void xmppCheckEmail(String email) {
		if (mProtocol != null) {
			if (ALXmppProtocol.getConnectionState() != ALXmppConnectionState.XMPP_STATE_IDLE) {
				// 当前已经连接了，那么先断开当前的连接
				mProtocol.logoff();
			}
		}
		ALXmppData data = new ALXmppData();
		data.setConnectionMode(ALXmppData.MODE_CHECK_EMAIL);
		data.setNetType(ALConnectionManager.getConnectionTypeString());
		mProtocol = new ALXmppProtocol(data, mListener);
		mData = data;
		// 开始登录咯
		mProtocol.start();
	}

	/**
	 * 第三方登陸
	 * 
	 * @param data
	 */
	public void xmppCheckThirdPartLoginState(ALXmppData data) {
		if (mProtocol != null) {
			if (ALXmppProtocol.getConnectionState() != ALXmppConnectionState.XMPP_STATE_IDLE) {
				// 当前已经连接了，那么先断开当前的连接
				mProtocol.logoff();
			}
		}
		data.setNetType(ALConnectionManager.getConnectionTypeString());
		mProtocol = new ALXmppProtocol(data, mListener);
		mData = data;
		// 开始登录咯
		mProtocol.start();
	}

	/**
	 * 登录IM服务器
	 * 
	 * @param data
	 * @author alonso lee
	 */
	public void xmppLogin(ALXmppData data) {
		if (mProtocol != null) {
			if (ALXmppProtocol.getConnectionState() != ALXmppConnectionState.XMPP_STATE_IDLE) {
				// 当前已经连接了，那么先断开当前的连接
				mProtocol.logoff();
			}
		}
		data.setNetType(ALConnectionManager.getConnectionTypeString());
		mProtocol = new ALXmppProtocol(data, mListener);
		mData = data;
		// 开始登录咯
		mProtocol.start();
	}

	public void xmppLogOff() {
		if (isLogined()) {
			mProtocol.logoff();
		}
	}

	/**
	 * 发送反馈
	 */
	public void xmppSendFeedBack() {
		if (isLogined()) {
//			mProtocol.sendFeedBack("alonso", "lizhenchang@gmail.com");
		}
	}

	/**
	 * 发送出席消息
	 * 
	 * @author alonso lee
	 */
	public boolean xmppSendPresence() {
		ALLog.d("calling xmppSendPresence");

		if ((mProtocol == null) || (!mProtocol.isAuthenticated())) {
			ALLog.w("No XMPP Connection.Refuse");
			return false;
		}
		mProtocol.setStatus(null, null, 50);
		return true;
	}

	/**
	 * 发送消息。支持发送文本或多媒体消息。支持群发。
	 * 
	 * @param msg
	 *            待发送的消息。请确保发送者(from)和接收者(to)不为空，并且为标准的jid。如:"8618676722583@mk"。
	 *            如果是多媒体消息，请 调用setType设置具体的消息类型。
	 * @return true 消息发送成功,false 消息发送失败
	 */
	public boolean xmppSendMessage(ALMessage msg) {
		ALLog.d("calling xmppSendMessage");

		if (msg == null) {
			return false;
		}

		if ((mProtocol == null) || (!mProtocol.isAuthenticated())) {
			ALLog.w("No XMPP Connection.Refuse");
			if (mListener != null) {
				// mListener.onSendMessageFailedEvents(msg.getMsgId());
			}
			return false;
		}
		return mProtocol.sendMessage(msg);

	}

	/**
	 * 发送c2s ping包请求
	 */
	public void xmppSendPingRequest() {

		ALLog.d("calling xmppSendMessage");

		if ((mProtocol == null) || (!mProtocol.isAuthenticated())) {
			ALLog.w("No XMPP Connection.Refuse");
			return;
		}
		mProtocol.sendPingRequest();
	}

	/**
	 * 响应服务器下发的S2C心跳包。此方法不会暴露给上层。
	 * 
	 * @return
	 * @author alonso lee
	 */
	private void xmppSendPingResponse(String id, String from, String to) {
		if (isLogined()) {
			mProtocol.sendPingResponse(id, from, to);
		}
	}

	public boolean isLogined() {
		if (mProtocol != null && mProtocol.isAuthenticated()) {
			return true;
		}
		ALLog.w("No XMPP Connection.");
		return false;
	}

	public void sendIqData(BaseIQTemplate data) {
		if (mProtocol != null && mProtocol.isAuthenticated()) {
			ALLog.w("No XMPP Connection.");
			return;
		}
		if (data == null) {
			ALLog.e("BaseIQTemplate data 不能为null");
			return;
		}
		mProtocol.sendXmppData(data.getIQXml());
		data.release();
		data = null;
	}

	/******************************* voip 方法 *************************************/

	/**
	 * 拨打voip电话
	 * 
	 * @param jid
	 *            被叫人jid
	 */
	public void xmppMakeVoipCall(String jid) {
		ALLog.d("calling xmppMakeVoipCall");

		if ((mProtocol == null) || (!mProtocol.isAuthenticated())) {
			ALLog.w("No XMPP Connection.Refuse");
			return;
		}

		mProtocol.makeVoipCall(jid);

	}

	/**
	 * 发送协议
	 * 
	 * @param data
	 */
	public void xmppSendXmppData(Object data) {
		ALLog.d("calling xmppSendXmppData");

		if ((mProtocol == null) || (!mProtocol.isAuthenticated())) {
			ALLog.w("No XMPP Connection.Refuse");
			return;
		}
		mProtocol.sendXmppData(data);
	}

	/**
	 * 接听voip电话
	 * 
	 * @param sessionId
	 *            回话id
	 */
	public void xmppAcceptVoipCall(String sessionId) {

		ALLog.d("calling xmppAcceptVoipCall");

		if ((mProtocol == null) || (!mProtocol.isAuthenticated())) {
			ALLog.w("No XMPP Connection.Refuse");
			return;
		}

		mProtocol.acceptVoipCall(sessionId);

	}

	/**
	 * 拒绝voip电话
	 * 
	 * @param sessionId
	 *            回话id
	 */
	public void xmppRejectVoipCall(String sessionId) {
		ALLog.d("calling xmppRejectVoipCall");

		if ((mProtocol == null) || (!mProtocol.isAuthenticated())) {
			ALLog.w("No XMPP Connection.Refuse");
			return;
		}

		mProtocol.rejectVoipCall(sessionId);
	}

	/**
	 * 挂断voip电话
	 * 
	 * @param sessionId
	 *            回话id
	 */
	public void xmppHandupVoipCall(String sessionId) {
		ALLog.d("calling xmppHandupVoipCall");

		if ((mProtocol == null) || (!mProtocol.isAuthenticated())) {
			ALLog.w("No XMPP Connection.Refuse");
			return;
		}

		mProtocol.handupVoipCall(sessionId);
	}

	/**
	 * 挂断voip电话
	 * 
	 * @param sessionId
	 *            回话id
	 */
	public void xmppVoipUploadNetState(String type) {
		ALLog.d("calling xmppVoipUploadNetState");

		if ((mProtocol == null) || (!mProtocol.isAuthenticated())) {
			ALLog.w("No XMPP Connection.Refuse");
			return;
		}

		mProtocol.voipUploadNetState(type);
	}

	/******************************* voip *************************************/

	@Override
	public void onJxaConnFailed(String msg, String conflictSid) {
		// TODO Auto-generated method stub
		mListener.onConnectLostEvent(msg, conflictSid);
	}

	@Override
	public void onJxaConnFailed(String msg) {
		// TODO Auto-generated method stub
		mListener.onConnectLostEvent(msg);
	}

	@Override
	public void onJxaConnStateChange(ALXmppConnectionState state,
			ALXmppConnectionState lastState) {
		// TODO Auto-generated method stub
		mListener.onConnectStateChangedEvent(state, lastState);
	}

	@Override
	public void onJxaAuth(final String username, final String passwrod,
			String token) {
		// TODO Auto-generated method stub
		mListener.onLoginedEvent(username, passwrod, token);
	}

	@Override
	public void onJxaAuthFailed(String message) {
		// TODO Auto-generated method stub
		mListener.onAuthFailedEvent(message);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaSessionIdUpdateEvent(java.lang.String)
	 */
	@Override
	public void onJxaSessionIdUpdateEvent(String sid) {
		// TODO Auto-generated method stub
		mListener.onSessionIdUpdateEvent(sid);
	}

	@Override
	public void onJxaLogoutEvent(boolean result) {
		// TODO Auto-generated method stub
		mListener.onLogoutEvent();
	}

	@Override
	public void onJxaChangePasswordEvent(int code, String newPwd) {
		// TODO Auto-generated method stub
		mListener.onChangePasswordEvent(code, newPwd);
	}

	@Override
	public void onJxaVAuthetication(final int code, VauthData data) {
		// TODO Auto-generated method stub
		mListener.onVAuthetication(code, data);
	}

	@Override
	public void onJxaVAutheticationState(final int code, VauthData data) {
		// TODO Auto-generated method stub
		mListener.onVAutheticationState(code, data);
	}

	@Override
	public void onJxaStatusEvent(String user, String show) {
		// TODO Auto-generated method stub
		mListener.onPresenceStatusEvent(user, show);
	}

	@Override
	public void onJxaErrorOccur(String code, String nameSpace) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onJxaALMessageEvent(final ALMessage msg) {
		// TODO Auto-generated method stub
		mListener.onReceiveMessage(msg);
	}

	@Override
	public void onJxaGetALMessageBackEvent(String from, String id) {
		// TODO Auto-generated method stub
		mListener.onReceiveMessageBackEvent(from, id);
	}

	@Override
	public void onJxaGetPingEvent(int type, String id, String from, String to) {
		// TODO Auto-generated method stub

		// 此条心跳包的类型。取值范围: "0" 服务器下发的S2C心跳包，程序必须响应。否则服务器将把连接断开
		// 。"1"服务器响应本程序上传的C2S心跳包。证明当前连接正常
		switch (type) {
		case 0:
			mListener.onGetPingPackageEvent(false);
			xmppSendPingResponse(id, from, to);
			ALLog.e("id " + id);
			break;
		case 1:
			mListener.onGetPingPackageEvent(true);
			break;
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#onJxaRegisterEvent
	 * (java.lang.String, java.lang.String, java.lang.String, int)
	 */
	@Override
	public void onJxaRegisterEvent(String jid, String password, String user,
			int code) {
		// TODO Auto-generated method stub
		mListener.onRegisterEvent(jid, password, user, code);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaThirdPartLoginResult(java.lang.String, java.lang.String)
	 */
	@Override
	public void onJxaThirdPartLoginResult(String uid, String password) {
		// TODO Auto-generated method stub
		mListener.onThirdPartLoginResult(uid, password);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#onJxaCheckEmailResult
	 * (boolean)
	 */
	@Override
	public void onJxaCheckEmailResult(boolean isRegistered) {
		// TODO Auto-generated method stub
		mListener.onCheckEmailResult(isRegistered);
	}

	/******************************* voip *************************************/

	@Override
	public void onJxaGetMakeVoipCallResult(int code, String session) {
		// TODO Auto-generated method stub
		mListener.onGetMakeVoipCallResult(code, session);
	}

	@Override
	public void onJxaGetAcceptVoipCallResult(int code, String sessionId,
			ALMessage msg) {
		// TODO Auto-generated method stub
		mListener.onGetAcceptVoipCallResult(code, sessionId, msg);

	}

	@Override
	public void onJxaGetRejectVoipCallResult(String sessionId) {
		// TODO Auto-generated method stub
		mListener.onGetRejectVoipCallResult(sessionId);
	}

	@Override
	public void onJxaGetHandUpVoipCallResult(String sessionId) {
		// TODO Auto-generated method stub
		mListener.onGetHandUpVoipCallResult(sessionId);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetEnterBaoMiHuaResult(int)
	 */
	@Override
	public void onJxaGetEnterBaoMiHuaResult(int code) {
		// TODO Auto-generated method stub
		mListener.onGetEnterBaoMiHuaResult(code);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetExitBaoMiHuaResult(int)
	 */
	@Override
	public void onJxaGetExitBaoMiHuaResult(int code) {
		// TODO Auto-generated method stub
		mListener.onGetExitBaoMiHuaResult(code);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#onJxaGetXiehouResult
	 * (int, boolean, java.util.ArrayList)
	 */
	@Override
	public void onJxaGetXiehouResult(int code, boolean hasMore, DatingUser users) {
		// TODO Auto-generated method stub
		mListener.onGetXiehouResult(code, hasMore, users);
	}

	/******************************* voip *************************************/

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetDiscoveryUsersResult(int, boolean, java.util.ArrayList)
	 */
	@Override
	public void onJxaGetDiscoveryUsersResult(int code, boolean hasMore,
			ArrayList<User> users) {
		// TODO Auto-generated method stub
		mListener.onGetDiscoveryUsersResult(code, hasMore, users);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetSearchUsersResult(int, boolean, java.util.ArrayList)
	 */
	@Override
	public void onJxaGetSearchUsersResult(String type, int code,
			boolean hasMore, ArrayList<User> users) {
		// TODO Auto-generated method stub
		mListener.onGetSearchUsersResult(type, code, hasMore, users);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#onJxaGetRankUsersResult
	 * (int, int, boolean, java.util.ArrayList)
	 */
	@Override
	public void onJxaGetRankUsersResult(int type, int code, boolean hasMore,
			ArrayList<User> users) {
		// TODO Auto-generated method stub
		mListener.onGetRankUsersResult(type, code, hasMore, users);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetFriendsAndFansResult(int, int, boolean, java.util.ArrayList)
	 */
	@Override
	public void onJxaGetFriendsAndFansResult(int type, int code,
			boolean hasMore, ArrayList<User> users, final int count,
			final String version) {
		// TODO Auto-generated method stub
		mListener.onGetFriendsAndFansResult(type, code, hasMore, users, count,
				version,null);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetDeletFriendOrFansResult(int, int, java.lang.String,
	 * java.lang.String)
	 */
	@Override
	public void onJxaGetDeletFriendOrFansResult(int type, int count,
			String version, String jid, int code) {
		// TODO Auto-generated method stub
		mListener.onGetDeletFriendOrFansResult(type, count, version, jid,code);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetAddNormalOrSpecialFavoritesResult(int, int, java.lang.String,
	 * com.alstudio.pojo.module.user.User)
	 */
	@Override
	public void onJxaGetAddNormalOrSpecialFavoritesResult(int type, int code,
			String version, User user) {
		// TODO Auto-generated method stub
		mListener.onGetAddNormalOrSpecialFavoritesResult(type, code, version,
				user);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaSetUserNoteNameResult(int, java.lang.String)
	 */
	@Override
	public void onJxaSetUserNoteNameResult(int code, String jid) {
		// TODO Auto-generated method stub
		mListener.onSetUserNoteNameResult(code, jid);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetUserProfileResult(int, com.alstudio.pojo.module.user.User)
	 */
	@Override
	public void onJxaGetUserProfileResult(int code, User u) {
		// TODO Auto-generated method stub
		mListener.onGetUserProfileResult(code, u);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetModifyUserProfileResult(int)
	 */
	@Override
	public void onJxaGetModifyUserProfileResult(int code) {
		// TODO Auto-generated method stub
		mListener.onGetModifyUserProfileResult(code);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaCommitVoiceIntroEvent(int)
	 */
	@Override
	public void onJxaCommitVoiceIntroEvent(int code) {
		// TODO Auto-generated method stub
		mListener.onCommitVoiceIntroEvent(code);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#onJxaGetUserOptEvent
	 * (int, com.alstudio.utils.notification.SystemSettings)
	 */
	@Override
	public void onJxaGetUserOptEvent(int code, SystemSettings settings) {
		// TODO Auto-generated method stub
		mListener.onGetUserOptEvent(code, settings);
	}

	/*********************************** 經濟系統 *****************************************************/

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxGetClearMoneyOrPointHistoryResult(int, int)
	 */
	@Override
	public void onJxGetClearMoneyOrPointHistoryResult(int code, int type) {
		// TODO Auto-generated method stub
		mListener.onGetClearMoneyOrPointHistoryResult(code, type);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetUserPointsResult(int, java.lang.String)
	 */
	@Override
	public void onJxaGetUserPointsResult(int code, String points) {
		// TODO Auto-generated method stub
		mListener.onGetUserPointsResult(code, points);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetEconomicRecordsResult(int, int, boolean, java.util.ArrayList)
	 */
	@Override
	public void onJxaGetEconomicRecordsResult(int code, int type,
			boolean hasMore, ArrayList<EconomicRecords> economicRecords) {
		// TODO Auto-generated method stub
		mListener.onGetEconomicRecordsResult(code, type, hasMore,
				economicRecords);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetRechagePriceResult(int, java.lang.String, java.util.ArrayList)
	 */
	@Override
	public void onJxaGetRechagePriceResult(int code, String type,
			ArrayList<RechargeItem> rechargeItems) {
		// TODO Auto-generated method stub
		mListener.onGetRechagePriceResult(code, type, rechargeItems);
	}

	/************************************** 道具系统 *****************************************************/

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetPropsMallListResult(int, java.util.ArrayList)
	 */
	@Override
	public void onJxaGetPropsMallListResult(int code, ArrayList<Props> propslist) {
		// TODO Auto-generated method stub
		mListener.onGetPropsMallListResult(code, propslist);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetCurrentBuyPropsInfoResult(int, java.util.ArrayList,
	 * com.alstudio.pojo.module.local.Prop, int)
	 */
	@Override
	public void onJxaGetCurrentBuyPropsInfoResult(int code,
			ArrayList<Prop> propslist, Prop curPorp, int propBuyCount) {
		// TODO Auto-generated method stub
		mListener.onGetCurrentBuyPropsInfoResult(code, propslist, curPorp,
				propBuyCount);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#onJxaGetMyPropsResult
	 * (int, java.util.ArrayList, int)
	 */
	@Override
	public void onJxaGetMyPropsResult(int code, ArrayList<Prop> proplist,
			int propSubscribecount) {
		// TODO Auto-generated method stub
		mListener.onGetMyPropsResult(code, proplist, propSubscribecount);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaGetPropsPurchaseInfoListResult(int, java.util.ArrayList)
	 */
	@Override
	public void onJxaGetPropsPurchaseInfoListResult(int code,
			ArrayList<Prop> proplist) {
		// TODO Auto-generated method stub
		mListener.onGetPropsPurchaseInfoListResult(code, proplist);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaDeletePropsPurchaseInfoListResult(int, boolean)
	 */
	@Override
	public void onJxaDeletePropsPurchaseInfoListResult(int code, boolean bool) {
		// TODO Auto-generated method stub
		mListener.onDeletePropsPurchaseInfoListResult(code, bool);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.alstudio.module.xmpp.protocol.xmpp.ALXmppListener#
	 * onJxaEffectivePropResult(int, boolean)
	 */
	@Override
	public void onJxaEffectivePropResult(int code, boolean bool) {
		// TODO Auto-generated method stub
		mListener.onGetEffectivePropResult(code, bool);
	}

}
